//
//  homeViewController.m
//  salesTerminals
//
//  Created by wu haifan on 12-9-6.
//  Copyright (c) 2012年 MICHAEL. All rights reserved.
//

#import "homeViewController.h"
#import "processEventListViewController.h"
#import "MainViewController.h"


@interface homeViewController ()
@property(strong,nonatomic) UIButton* sales;
@property(strong,nonatomic) UIButton* processEvent;
@property(strong,nonatomic) UIButton* message;
@property(strong,nonatomic) UIButton* backLog;

@end

@implementation homeViewController

@synthesize sales=_sales;
@synthesize processEvent=_processEvent;
@synthesize message=_message;
@synthesize backLog=_backLog;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = @"主页面";
    
    self.view.backgroundColor = [UIColor cyanColor];
    
    self.sales=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.sales.frame=CGRectMake(350, 20, 100, 60);
    [self.sales setTitle:@"销售业绩" forState:UIControlStateNormal];
    [self.sales addTarget:self action:@selector(tiaozhuan1:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.sales];
    
    self.sales=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.sales.frame=CGRectMake(350, 140, 100, 60);
    [self.sales setTitle:@"代办事宜" forState:UIControlStateNormal];
    [self.sales addTarget:self action:@selector(tiaozhuan2:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.sales];
    
    self.sales=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.sales.frame=CGRectMake(350, 260, 100, 60);
    [self.sales setTitle:@"已办事宜" forState:UIControlStateNormal];
    [self.sales addTarget:self action:@selector(tiaozhuan3:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.sales];
    
    self.sales=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.sales.frame=CGRectMake(350, 380, 100, 60);
    [self.sales setTitle:@"通知" forState:UIControlStateNormal];
    [self.sales addTarget:self action:@selector(tiaozhuan4:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.sales];
    
	// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void) tiaozhuan1:(id) sender{
    
}
-(void) tiaozhuan2:(id) sender{
    
    MainViewController * viewController = [[MainViewController alloc] init];
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
    self.view.window.rootViewController=navController;
    
    MainViewController*dealWithView=[[MainViewController alloc] init];
    [self.navigationController pushViewController:dealWithView animated:YES]; 
    
}
-(void) tiaozhuan3:(id) sender{
    processEventListViewController * viewController = [[processEventListViewController alloc] init];
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
    self.view.window.rootViewController=navController;
    
    processEventListViewController*dealWithView=[[processEventListViewController alloc] init];
    [self.navigationController pushViewController:dealWithView animated:YES];
}
-(void) tiaozhuan4:(id) sender{
    
}

@end
